function updateInfoBtn() {
    let action = document.getElementById("updateInfo");
    action.setAttribute("style","display:block");
}
function updateInfo(){
    let userName = document.getElementsByName("userName")[0].value ;
    let email = document.getElementsByName("email")[0].value ;
    let mobile = document.getElementsByName("mobile")[0].value ;
    let id = document.getElementsByName("id")[0].value ;
    $.ajax({
        url:"/user/update/"+userName+"/"+email+"/"+mobile,
        type:"POST",
        success:function (data) {
            if(data == "success"){
                document.getElementById("updateInfo").setAttribute("style","display:none")
                window.location.href="http://localhost:8011/userInfo";
            }else {
                alert("信息错误");
            }
        }
    });
}
function updateStatus(t){
    // console.log(t)
    console.log(t.value)
    $.ajax({
        url:"/orders/"+t.value,
        type:"PUT",
        success:function (result) {
            console.log(result)
            if(result.status == 200){
                alert("收货成功");
                window.location.href="http://localhost:8011/user/orderList";
            }else {
                alert("收货错误");
            }
        }
    });
}

